#导入蓝图
from flask import Blueprint,request,jsonify

#实例化蓝图
goods = Blueprint('goods',__name__)

#导入数据库类并实例化
from db import Db
db= Db()

@goods.route('/goods/',methods=["GET"])
async def get_goods():
    #查询
    sql = "select * from goods"
    #调用类方法
    res = db.get_all(sql)
    print(res)
    return jsonify({'code':200,'list':res})
